﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HotelManagementClient.Utlis
{
    public class DateUtil
    {
        /// <summary>
        /// 获取当前时间
        /// 2024年04月01日
        /// 
        /// </summary>
        /// <returns> </returns>
        public static string NowD()
        {
            return System.DateTime.Now.ToString("yyyy年MM月dd日"); 
        }

        /// <summary>
        /// 获取当前时间
        /// 2024-04-01
        /// </summary>
        /// <returns> </returns>
        public static string Nowd()
        {
            return System.DateTime.Now.ToString("yyyy-MM-dd");
        }

        /// <summary>
        /// 获取当前时间 
        /// 2017年7月24日 13:46:15
        /// </summary>
        /// <returns></returns>
        public static string NowF()
        {
            return System.DateTime.Now.ToString("F");
        }

        /// <summary>
        /// 获取当前时间
        /// 2017年7月24日 13:46
        /// </summary>
        /// <returns></returns>
        public static string Nowf()
        {
            return System.DateTime.Now.ToString("f");
        }

        /// <summary>
        /// 获取当前时间
        /// 2017-7-24 13:46:15
        /// </summary>
        /// <returns></returns>
        public static string NowG()
        {
            return System.DateTime.Now.ToString("G");
        }
        /// <summary>
        /// 获取当前时间
        /// 2017-7-24 13:46
        /// </summary>
        /// <returns></returns>
        public static string Nowg()
        {
            return System.DateTime.Now.ToString("g");
        }

        /// <summary>
        /// 获取当前时间
        /// 13:46:15
        /// </summary>
        /// <returns></returns>
        public static string NowT()
        {
            return System.DateTime.Now.ToString("T");
        }
        /// <summary>
        /// 获取当前时间
        /// 13:46
        /// </summary>
        /// <returns></returns>
        public static string Nowt()
        {
            return System.DateTime.Now.ToString("t");
        }

        /// <summary>
        /// 获取当前时间
        /// 2017年7月24日 8:46:15
        /// </summary>
        /// <returns></returns>
        public static string NowU()
        {
            return System.DateTime.Now.ToString("U");
        }
        /// <summary>
        /// 获取当前时间
        /// 2017-07-24 13:46:15Z
        /// </summary>
        /// <returns></returns>
        public static string Nowu()
        {
            return System.DateTime.Now.ToString("u");
        }

        /// <summary>
        /// 获取当前时间
        /// 7月24日
        /// </summary>
        /// <returns></returns>
        public static string NowM()
        {
            return System.DateTime.Now.ToString("M");
        }

        /// <summary>
        /// 获取当前时间
        /// 7月24日
        /// </summary>
        /// <returns></returns>
        public static string Nowm()
        {
            return System.DateTime.Now.ToString("m");
        }

        /// <summary>
        /// 获取当前时间
        /// Tue, 24 July 2017 13:46:15 GMT
        /// </summary>
        /// <returns></returns>
        public static string NowR()
        {
            return System.DateTime.Now.ToString("R");
        }

        /// <summary>
        /// 获取当前时间
        /// Tue, 24 July 2017 13:46:15 GMT
        /// </summary>
        /// <returns></returns>
        public static string Nowr()
        {
            return System.DateTime.Now.ToString("r");
        }

        /// <summary>
        /// 获取当前时间
        /// 2017年7月
        /// </summary>
        /// <returns> </returns>
        public static string NowY()
        {
            return System.DateTime.Now.ToString("Y");
        }

        /// <summary>
        /// 获取当前时间
        /// 2017年7月
        /// </summary>
        /// <returns> </returns>
        public static string Nowy()
        {
            return System.DateTime.Now.ToString("y");
        }

        /// <summary>
        /// 获取当前时间
        /// 2017-07-24T15:52:19.1562500+08:00
        /// </summary>
        /// <returns></returns>
        public static string NowO()
        {
            return System.DateTime.Now.ToString("O");
        }

        /// <summary>
        /// 获取当前时间
        /// 2017-07-24T15:52:19.1562500+08:00
        /// </summary>
        /// <returns></returns>
        public static string Nowo()
        {
            return System.DateTime.Now.ToString("o");
        }

        /// <summary>
        /// 获取当前时间
        /// 2017-07-24T13:46:15
        /// </summary>
        /// <returns> </returns>
        public static string Nows()
        {
            return System.DateTime.Now.ToString("s");
        }

        /// <summary>
        /// 获取当前时间
        /// 2017-07-24 15:52:19
        /// </summary>
        /// <returns> </returns>
        public static string NowDateZ()
        {
            return System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
        }

        /// <summary>
        /// 获取当前时间
        /// 2017年07月24 15时56分48秒
        /// </summary>
        /// <returns> </returns>
        public static string NowDateH()
        {
            return System.DateTime.Now.ToString("yyyy年MM月dd HH时mm分ss秒");
        }

        /// <summary>
        /// 获取当前时间戳
        /// </summary>
        /// <returns></returns>
        public static long NowDataTimeStamp() 
        {
            // 获取当前时间的时间戳
            DateTime currentTime = DateTime.Now;
            long timestamp = (long)(currentTime - new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalSeconds;
            return timestamp;
        }
    }
}
